﻿using Microsoft.Build.Evaluation;
using OD.ProjectCustomizationTool.Helpers;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace OD.ProjectCustomizationTool.Tools
{
    /// <summary>
    /// <see cref="http://msdn.microsoft.com/en-us/library/bb514188.aspx"/>
    /// </summary>
    internal sealed class CodeAnalysisDictionaryCustomizer : ProjectUpdaterFromQualityFileBase
    {
        #region Properties

        protected override string QualityFileName
        {
            get { return Properties.Resources.CustomDictionaryFileName; }
        }

        #endregion

        #region Methods

        protected override void InternalCreateQualityFile()
        {
            this.CopyFile(this.ResourceQualityFileFullPath, this.QualityFileFullPath);
        }

        protected override void InternalUpdate()
        {
            this.SetProjectProperty(Properties.Resources.CodeAnalysisDictionaryProjectProperty, this.RelativePathToQualityFile);
            this.AddItemAsLink(Properties.Resources.CodeAnalysisDictionaryProjectItem, this.RelativePathToQualityFile);
        }

        #endregion

    }
}
